import request from '@/config/axios'

// 商品采购仓库 VO
export interface PurchaseStoreVO {
  id: number // 仓库id
  storeName: string // 仓库名称
}

// 商品采购仓库 API
export const PurchaseStoreApi = {
  // 查询商品采购仓库分页
  getPurchaseStorePage: async (params: any) => {
    return await request.get({ url: `/admin-api/product/purchase-store/page`, params })
  },

  // 查询商品采购仓库详情
  getPurchaseStore: async (id: number) => {
    return await request.get({ url: `/admin-api/product/purchase-store/get?id=` + id })
  },

  // 新增商品采购仓库
  createPurchaseStore: async (data: PurchaseStoreVO) => {
    return await request.post({ url: `/admin-api/product/purchase-store/create`, data })
  },

  // 修改商品采购仓库
  updatePurchaseStore: async (data: PurchaseStoreVO) => {
    return await request.put({ url: `/admin-api/product/purchase-store/update`, data })
  },

  // 删除商品采购仓库
  deletePurchaseStore: async (id: number) => {
    return await request.delete({ url: `/admin-api/product/purchase-store/delete?id=` + id })
  },

  // 导出商品采购仓库 Excel
  exportPurchaseStore: async (params) => {
    return await request.download({ url: `/admin-api/product/purchase-store/export-excel`, params })
  },
}
